import request from '@/utils/request'


/**查询店铺sku种类数 */
export function batchShopSkuList(params,) {
  return request({
    url: '/distribution/orderSku/batchShopSkuList',
    params
  })
}


/**尝试自动付款批次 */
export function tryPayBatch(data,) {
  return request({
    url: '/distribution/orderBatch/tryPayBatch',
    method: 'post',
    data
  })
}

/**查询商家店铺关联列表 */
export function distributorShopQueryList(params,) {
  return request({
    url: '/distribution/distributorShop/queryList',
    params
  })
}


/**批次 导出面单 */
export function exportExpressSheet(params,) {
  return request({
    url: '/distribution/orderBatch/exportExpressSheet',
    params
  })
}


/**批次 SKU销售情况 */
export function batchSkuSell(params,) {
  return request({
    url: '/distribution/orderBatch/batchSkuSell',
    params
  })
}


/**快递方式下拉 */
export function expressWay() {
  return request({
    url: '/distribution/express/select',
  })
}

/**修改订单包裹 */
export function editOrderPackage(data) {
  return request({
    url: '/distribution/orderPackage',
    method: 'put',
    data
  })
}

/**查询批次 包裹列表 */
export function orderPackageList(params) {
  return request({
    url: '/distribution/orderPackage/list',
    params
  })
}

/**批次 聚合SKU列表 */
export function batchSkuList(params) {
  return request({
    url: '/distribution/orderBatch/batchSkuList',
    params
  })
}

/**修改订单主单 */
export function updateOrder(data) {
  return request({
    url: '/distribution/order',
    method: 'put',
    data
  })
}



/**deletePackage */
export function deletePackage(packageId) {
  return request({
    url: '/distribution/orderPackage/deletePackage/' + packageId,
    method: 'delete',
  })
}


/**删除订单批次 */
export function deleteOrderBatch(ids) {
  return request({
    url: '/distribution/orderBatch/' + ids,
    method: 'delete',
  })
}

/**查询未生成包裹批次 聚合SKU数量 */
export function unSendskuList(query) {
  return request({
    url: '/distribution/orderBatch/skuList',
    method: 'get',
    params: query
  })
}

/**查询订单批次列表 */
export function orderBatchList(query) {
  return request({
    url: '/distribution/orderBatch/list',
    method: 'get',
    params: query
  })
}
/**平台订单导入，平台类型 1-亚马逊 2-乐天 3-雅虎拍卖 4-雅虎商城 5-煤炉(法人) 6-沃尔玛  7-煤炉(个人)*/
export function importPlatformData(data, platformType) {
  return request({
    url: `/distribution/distribution/importPlatformData?platformType=${platformType}`,
    method: 'post',
    data
  })
}


export function distributorShop(params) {
  return request({
    url: '/distribution/distributorShop/list',
    method: 'get',
    params
  })
}
export function orderBatch(params) {
  return request({
    url: `/distribution/orderBatch/${params}`,
    method: 'get',
  })
}
/**订单列表 */
export function distributionOrder(params) {
  return request({
    url: `/distribution/order/list`,
    method: 'get',
    params
  })
}
// // 新增仓库库位
// export function addStockPosition(data) {
//   return request({
//     url: '/distribution/stockPosition',
//     method: 'post',
//     data: data
//   })
// }

// // 修改仓库库位
// export function updateStockPosition(data) {
//   return request({
//     url: '/distribution/stockPosition',
//     method: 'put',
//     data: data
//   })
// }

// 删除订单主单
export function distributionOrderDelete(id) {
  return request({
    url: '/distribution/order/' + id,
    method: 'delete'
  })
}

/**更新库存核销*/
export function updateStockFlag(data) {
  return request({
    url: `/distribution/orderBatch/updateStockFlag`,
    method: 'post',
    data
  })
}
/**导出包裹 */
export function exportPackage(data) {
  return request({
    url: `/distribution/orderBatch/exportPackage`,
    method: 'post',
    data
  })
}

/**勾选批次生成包裹 */
export function generatePackage(data) {
  return request({
    url: `/distribution/orderBatch/generatePackage`,
    method: 'post',
    data
  })
}

/**勾选批次生成包裹 */
export function sendMsgExport(data) {
  return request({
    url: `/distribution/orderBatch/sendMsgExport`,
    method: 'post',
    data
  })
}

/**卖家预测试生成包裹 */
export function preTestGeneratePackage(data) {
  return request({
    url: `/distribution/orderBatch/preTestGeneratePackage`,
    method: 'post',
    data
  })
}

/**批次包裹回滚 */
export function batchPackageRollback(data) {
  return request({
    url: `/distribution/orderBatch/batchPackageRollback`,
    method: 'post',
    data
  })
}


/**统计快递 */
export function statisticalExpress(data) {
  return request({
    url: `/distribution/orderBatch/statisticalExpress`,
    method: 'post',
    data,
    repetitiveConfig: {
      neglectful: true,
      interval: 3000
    },
  })
}



/**导出邮局金额统计 */
export function exportPostOfficeAmountStatistical(data) {
  return request({
    url: `/distribution/orderBatch/exportPostOfficeAmountStatistical`,
    method: 'post',
    data,

  })
}
export function selectTrilateralSize(params) {
  return request({
    url: `/distribution/express/selectTrilateralSize`,
    params,
    method: 'get',
  })
}

export function orderPackageChange(params) {
  return request({
    url: `/distribution/orderPackageChange/list`,
    params,
    method: 'get',
  })
}


